import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/home',
		name: 'Home',
		component: Home,
		children: [{
				path: '/home',
				name: 'Main',
				component: () => import('../views/Main.vue')
			},
			{
				path: '/home/shopcart',
				name: 'shopcart',
				component: () => import('../views/ShoppingCar.vue')
			},
			{
				path: '/home/orders',
				name: 'Orders',
				component: () => import('../views/Orders.vue')
			},
			{
				path: '/home/mine',
				name: 'Mine',
				component: () => import('../views/Mine.vue')
			},
			{
				path: '/home/search',
				name: 'Search',
				component: () => import('../views/Search.vue')
			},
			{
				path: '/searchdetails',
				name: 'SearchDetails',
				component: () => import('../views/SearchDetails.vue')
			},
		]
	},
	{
		path: '/',
		name: 'Login',
		component: () => import('../views/Login.vue')
	},
	{
		path: '/register',
		name: 'register',
		component: () => import('../views/Register.vue')
	},
	{
		path: '/addaddress',
		name: 'AddAddress',
		component: () => import('../views/AddAddress.vue')
	},
	{
		path: '/editaddress',
		name: 'EditAddress',
		component: () => import('../views/EditAddress.vue')
	},
	{
		path: '/address',
		name: 'Address',
		component: () => import('../views/Address.vue')
	},
	{
		path: '/suborder',
		name: 'SubOrder',
		component: () => import('../views/SubOrder.vue')
	},
	{
		path: '/yorder',
		name: 'YOrder',
		component: () => import('../views/YOrder.vue')
	},
	{
		path: '/payorder',
		name: 'PayOrder',
		component: () => import('../views/PayOrder.vue')
	},
	{
		path: '/shopsinfo',
		name: 'ShopsInfo',
		component: () => import('../views/ShopsInfo.vue')
	},
	{
		path: '/shopsdetails',
		name: 'ShopsDetails',
		component: () => import('../views/ShopsDetails.vue'),
	},
	{
		path: '/shops',
		name: 'Shops',
		component: () => import('../views/Shops.vue')
	},
	{
		path: '/makeorder',
		name: 'MakeOrder',
		component: () => import('../views/MakeOrder.vue')
	},
	{
		path: '/myorder',
		name: 'MyOrder',
		component: () => import('../views/MyOrder.vue')
	},
]

const router = new VueRouter({
	routes
})

export default router
